/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.gap.entities;

import java.io.Serializable;
import java.math.BigDecimal;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Yunita
 */
@Entity
@Table(name = "gap_master_item")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "GapMasterItem.findAll", query = "SELECT g FROM GapMasterItem g"),
    @NamedQuery(name = "GapMasterItem.findBySync", query = "SELECT g FROM GapMasterItem g WHERE g.sync = :sync"),
    @NamedQuery(name = "GapMasterItem.findByItemId", query = "SELECT g FROM GapMasterItem g WHERE g.itemId = :itemId"),
    @NamedQuery(name = "GapMasterItem.findByItemName", query = "SELECT g FROM GapMasterItem g WHERE g.itemName = :itemName"),
    @NamedQuery(name = "GapMasterItem.findByItemDiscount", query = "SELECT g FROM GapMasterItem g WHERE g.itemDiscount = :itemDiscount")})
public class GapMasterItem implements Serializable {
    private static final long serialVersionUID = 1L;
    @Column(name = "sync")
    private String sync;
    @Id
    @Basic(optional = false)
    @Column(name = "item_id")
    private Integer itemId;
    @Column(name = "item_name")
    private String itemName;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "item_discount")
    private BigDecimal itemDiscount;

    public GapMasterItem() {
    }

    public GapMasterItem(Integer itemId) {
        this.itemId = itemId;
    }

    public String getSync() {
        return sync;
    }

    public void setSync(String sync) {
        this.sync = sync;
    }

    public Integer getItemId() {
        return itemId;
    }

    public void setItemId(Integer itemId) {
        this.itemId = itemId;
    }

    public String getItemName() {
        return itemName;
    }

    public void setItemName(String itemName) {
        this.itemName = itemName;
    }

    public BigDecimal getItemDiscount() {
        return itemDiscount;
    }

    public void setItemDiscount(BigDecimal itemDiscount) {
        this.itemDiscount = itemDiscount;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (itemId != null ? itemId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof GapMasterItem)) {
            return false;
        }
        GapMasterItem other = (GapMasterItem) object;
        if ((this.itemId == null && other.itemId != null) || (this.itemId != null && !this.itemId.equals(other.itemId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return itemName;
//        return "com.gap.entities.GapMasterItem[ itemId=" + itemId + " ]";
    }
    
}
